<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .table{
            width:100%;
            border-collapse: collapse;
            text-align: center;
        }
        .table td,.table th{
            border: 1px solid #ccc;
            text-align: center;
        }
    </style>
</head>
<body>
    <h2 class="title">Node 封装 MongoDB</h2>
    <section>
        <table class="table">
            <tr>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>操作</th>
            </tr>
            {{each list}}
            <tr>
                <td>{{$value.name}}</td>
                <td>{{$value.age}}</td>
                <td>{{$value.sex}}</td>
                <!--对于 id 加上@ 是让输出的时候不带引号，否则会引发错误-->
                <td><a href="/edit?id={{@$value._id}}">编辑</a> 　<a href="/delete?id={{@$value._id}}">删除</a></td>
            </tr>
            {{/each}}
        </table>
    </section>
</body>
</html>